Repository navigation
fix: make layer toggles, stress slider, and feature popup keyboard and screen reader accessible (#4) - #16
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…d popup (#4) Adds @testing-library/user-event as a devDependency for real Tab, Space, Enter, and Escape sequences. Records in the plan that user-event cannot step range inputs with arrow keys, so the slider test dispatches the one-step change and arrow keys are verified in the live drive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…d screen reader accessible (#4) Layer checkboxes are visually hidden instead of display none and named "<Label> layer"; the stress slider is named and exposes aria-valuetext. The feature popup is a dialog labelled by its title that takes focus on open, closes on Escape, and returns focus on close. Adds focus-visible outlines in the accent color for rows, slider, popup, and close button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
When the user has moved focus outside the non-modal popup, closing it must not pull focus back to the element focused before it opened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
…#4) The non-modal popup closes on Escape from anywhere, so always refocusing the saved element pulled focus away from controls the user had moved to. Cleanup now restores focus only when it fell back to body because the dialog node was removed. Records this and the close button type="button" in the plan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the layer panel and the feature popup work with a keyboard and a screen reader.
.visually-hiddenutility instead ofdisplay: none, so they are back in the Tab order and the accessibility tree. Each one is named " layer", for example "Airports layer". The decorative dot and the ON/OFF text arearia-hidden, since the checked state already says it. A focused row shows an inset 2px accent outline (.layer-row:has(input:focus-visible)).aria-valuetextsuch as "500,000 points".outline: noneis replaced by a:focus-visibleoutline.role="dialog", labelled by its "FEATURE INTEL" title. Focus moves to the dialog when it opens, and Escape closes it. On close, focus goes back to the element that had it before the popup opened, as long as focus was still inside the dialog. If the user has moved focus to another control, it stays there. The close button is named "Close", its glyph isaria-hidden, it hastype="button", and it has a focus outline.@testing-library/user-eventis added as a dev dependency so the tests can send real Tab, Space, Enter and Escape key presses.Not in this PR:
--accenttoken.Plan
docs/plans/2026-11-07-issue-4-keyboard-screen-reader-a11y.md, committed in 5b4bcdf. Changes made during implementation, all recorded under the plan's Deviations:type="button"added.Test evidence
Gate on 31b496a, run in order, all exit 0:
npm cinpm run lintnpm testnpm run buildnpm audit --omit=dev --audit-level=highTDD:
Lighthouse accessibility (lighthouse 12, headless Chrome,
vite previewof the production build):labelon the stress-test range inputThere are no label or name failures. The hidden checkboxes were not flagged before because
display: nonetook them out of the audit entirely.Live drive in Chrome against
vite preview, by the implementer and separately by a fresh verifier:overflow: hidden. Clicking a row with the mouse shows no ring.aria-valuetextand the "500K PTS" readout follow. Home resets it to 0.getByRole('checkbox', { name: 'Heatmap layer' })).Review findings
type="button"on Close was not in the plan (Fable finder). It is now recorded there.body, and Escape then moves focus to the opener. Focus onbodymeans focus is lost, not placed somewhere. Moving it back to the opener avoids losing focus (WCAG 2.4.3), and leaving it onbodywould be worse for keyboard users.isComposinganddefaultPrevented. No other Escape handler exists on the page.Docs reconciled
README.md: no change needed. Nothing in it describes the controls' keyboard or screen reader behavior.CLAUDE.md: no change needed. The Testing Library rule still holds, and user-event is part of Testing Library.Out of scope, seen during this work: the stress count readout ("0 PTS") is cut off at the panel's right edge on main as well. The range input keeps Chrome's default width of about 129px, so 129 + 8 gap + 56 min-width comes to more than the panel's roughly 172px of usable width (
src/index.css.stress-row,.stress-count). This probably belongs with #5 or #7.Closes #4
🤖 Generated with Claude Code
https://claude.ai/code/session_01AELE7jB1i3uqqrHu3SjJjf